home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
networ1a
/
whois.frm
< prev
next >
Wrap
Text File
|
1999-07-16
|
4KB
|
147 lines
VERSION 5.00
Object = "{FFACF7F3-B868-11CE-84A8-08005A9B23BD}#1.7#0"; "DSSOCK32.OCX"
Begin VB.Form Form1
BorderStyle = 3 'Fixed Dialog
Caption = "WhoIs Example"
ClientHeight = 3885
ClientLeft = 1140
ClientTop = 1515
ClientWidth = 5775
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
PaletteMode = 1 'UseZOrder
ScaleHeight = 3885
ScaleWidth = 5775
ShowInTaskbar = 0 'False
Begin VB.CommandButton Command1
Caption = "Proccess Request"
Height = 255
Left = 2040
TabIndex = 4
Top = 3600
Width = 1455
End
Begin VB.TextBox text2
Height = 285
Left = 1920
TabIndex = 2
Text = "hackers.com"
Top = 0
Width = 3855
End
Begin VB.TextBox Text1
Height = 3135
Left = 0
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 1
Top = 360
Width = 5775
End
Begin dsSocketLib.dsSocket dsSocket1
Height = 420
Left = 4080
TabIndex = 0
Top = 3480
Width = 420
_Version = 65543
_ExtentX = 741
_ExtentY = 741
_StockProps = 64
LocalPort = 31337
RemoteHost = "whois.internic.net"
RemotePort = 43
ServiceName = ""
RemoteDotAddr = ""
Linger = -1 'True
Timeout = 10
LineMode = 0 'False
EOLChar = 10
BindConnect = 0 'False
SocketType = 0
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "Domain name to look up:"
Height = 255
Left = 0
TabIndex = 3
Top = 0
Width = 1815
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim lByteCount As Long
Private Sub Command1_Click()
' use the whois server known as rs4.internic.net
' clear any previous query results first
Text1 = ""
' clear the byte count
lByteCount = 0
dsSocket1.RemoteHost = "whois.internic.net"
' whois servers await us on port 43 ;]
dsSocket1.RemotePort = 43
' well alrighty kids, its time to connect.
dsSocket1.Connect
End Sub
Private Sub dsSocket1_Connect()
On Error Resume Next
' send the name of the domain we want to get
' the info or what ever on.
dsSocket1.Send = Text2 & vbCrLf
End Sub
Private Sub dsSocket1_Exception(ErrorCode As Integer, ErrorDesc As String)
MsgBox ErrorDesc
End Sub
Private Sub dsSocket1_Receive(ReceiveData As String)
On Error Resume Next
Dim strData As String
' save the incoming data
strData = ReceiveData
' count the bytes
lByteCount = lByteCount + Len(strData)
' the incoming data stream uses only LF characters
' to denote a line wrap (ala Unix) so we'll precede
' them with a CR so that the standard VB textbox will
' wrap the lines correctly
While InStr(strData, Chr(10)) > 0
Text1 = Text1 & Left(strData, InStr(strData, Chr(10)) - 1) & Chr(13) & Chr(10)
strData = Mid(strData, InStr(strData, Chr(10)) + 1)
Wend
' if there's anything left then add it to the textbox
Text1 = Text1 & strData
dsSocket1.Close
End Sub
Private Sub dsSocket1_SendReady()
End Sub